// axios
import axios from 'axios'

// 加载进度条
// import 'nprogress/nprogress.css'
import NProgress from 'nprogress'

const request = axios.create({
  baseURL: 'http://127.0.0.1:8887/api/private/v1/'
})

request.interceptors.request.use((config) => {
  NProgress.start()
  config.headers.Authorization = sessionStorage.getItem('token')
  return config
})

request.interceptors.response.use((config) => {
  NProgress.done()
  return config
})

export default request
